//TOWN SCRIPT TEMPLATE

begintownscript;

variables;
string dlgstr;

body;

beginstate INIT_STATE;
	set_crime_tolerance(1);
change_blocked(28,3,1);
change_blocked(27,3,1);
change_blocked(26,3,1);
change_blocked(25,3,1);
change_blocked(25,4,1);
change_blocked(25,5,1);
change_blocked(25,6,1);
change_blocked(24,3,1);
change_blocked(24,4,1);
change_blocked(24,5,1);
change_blocked(24,6,1);
change_blocked(28,3,1);
change_blocked(28,4,1);
change_blocked(28,5,1);
change_blocked(28,6,1);
change_blocked(27,6,1);
change_blocked(26,6,1);
change_blocked(28,7,1);
change_blocked(27,7,1);
change_blocked(26,7,1);
change_blocked(25,7,1);

if (get_flag(1,1) == 0) {
	reset_dialog();
	add_dialog_str(0,"Welcome to Nobody's Heroes! Please note that this scenario assumes that you are using a party fairly near the default starting party. For the plot to make the most sense, your characters should conform to the following specifications:",0);
	add_dialog_str(1,"First character: a level 1 male fighter. You, for all intents and purposes. Sincere. The straight man.",0);
	add_dialog_str(2,"Second character: also a level 1 male fighter. A brute. Says little, mostly burps and scratches.",0);
	add_dialog_str(3,"Third character: a level 1 female, probably a mage. Teenaged. Giggles a lot.",0);
	add_dialog_str(4,"Fourth character: level 1, probably a male wizard of some sort. Serious but grumpy.",0);
	add_dialog_str(5,"You are welcome to play with any party you like, but most of dialogue will assume you have this party. Also, I have made no effort to fix potential bugs that would appear only for high-level parties. Finally, for full effect, sounds should be ON.",0);
	set_flag(1,1,run_dialog(1));
	}
break;

beginstate EXIT_STATE;
//called when the party leaves the town
	text_bubble_on_char(0,"");
	text_bubble_on_char(1,"");
	text_bubble_on_char(2,"");
	text_bubble_on_char(3,"");

break;

beginstate START_STATE;
//called every turn when the party is in the town

break;

beginstate 10;
if (get_flag(1,0) == 0) {
	block_entry(1);
	
	message_dialog("On your journey, you stop for a bite to eat. The four of you pull up chairs.","");
	
	set_terrain(12,16,228);
	set_terrain(16,20,225);
	set_terrain(20,16,226);
	set_terrain(16,12,227);
	force_view_center(16,16);
	relocate_character(0,12,16);
	relocate_character(1,16,20);
	relocate_character(2,20,16);
	relocate_character(3,16,12);
	force_instant_terrain_redraw();
	pause(1 * get_flag(290,0));

	message_dialog("You think that now might be a good time to engage your fellow travelers, your good friends, your buddies who would die for you and you for them, in conversation.","");
	
	text_bubble_on_char(0,"So!");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));
	
	text_bubble_on_char(0,"");
	text_bubble_on_char(0,"What is the real meaning of life?");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));
	
	text_bubble_on_char(0,"");
	text_bubble_on_char(0,"What do you think,");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));
	
	clear_buffer();
	append_char_name(1);
	append_string("?");
	get_buffer_text(dlgstr);

	text_bubble_on_char(0,"");
	text_bubble_on_char(0,dlgstr);
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(0,"");
	text_bubble_on_char(1,"*chomp*");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(1,"");
	text_bubble_on_char(1,"*belch*");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(1,"");
	text_bubble_on_char(1,"*scratch*");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(1,"");
	text_bubble_on_char(0,"Um...");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(0,"");
	text_bubble_on_char(0,"Okay.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(0,"");
	force_instant_terrain_redraw();
	
	message_dialog("Realizing that your first effort did not go as well as you might've liked, you try again.","");

	text_bubble_on_char(0,"Well,");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(0,"");
	text_bubble_on_char(0,"how about you,");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));
	
	clear_buffer();
	append_char_name(2);
	append_string("?");
	get_buffer_text(dlgstr);

	text_bubble_on_char(0,"");
	text_bubble_on_char(0,dlgstr);
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(0,"");
	text_bubble_on_char(2,"You know what I've always wondered?");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(2,"");
	text_bubble_on_char(2,"Like, when it like, rains,");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(2,"");
	text_bubble_on_char(2,"oh my GOD, and it's like, so wet,");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(2,"");
	text_bubble_on_char(2,"why doesn't the Sun go out?");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(2,"");
	text_bubble_on_char(0,"...");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(0,"");
	force_instant_terrain_redraw();
	
	message_dialog("Undaunted, because, you figure, who the hell needs daunts, you turn to your third comrade.","");

	text_bubble_on_char(0,"Well, er,");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(0,"");
	text_bubble_on_char(0,"what do you think");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(0,"");
	text_bubble_on_char(0,"about the meaning of life,");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));
	
	clear_buffer();
	append_char_name(3);
	append_string("?");
	get_buffer_text(dlgstr);

	text_bubble_on_char(0,"");
	text_bubble_on_char(0,dlgstr);
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(0,"");
	text_bubble_on_char(3,"Don't start with me,");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));
	
	clear_buffer();
	append_char_name(0);
	append_string(".");
	get_buffer_text(dlgstr);

	text_bubble_on_char(3,"");
	text_bubble_on_char(3,dlgstr);
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"I've been marching");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"three steps behind you");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"for who knows how long");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"in these parched hills.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"Leave me be.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	force_instant_terrain_redraw();

	message_dialog("Well, your faithful companions, your best friends in the whole world, the people who would die for you and you for them, were never really much for conversation, anyway.","You finish your meal and get ready to go. Along the road to the west, if the reports of passers-by are to be believed, there is a town nearby. The prospect of a real bed in an inn, no matter how simple or basic, is one you cannot pass up at the moment.");
	
	
	set_terrain(12,16,0);
	set_terrain(16,20,0);
	set_terrain(20,16,0);
	set_terrain(16,12,0);
	march_party(15,15);
	march_party(15,14);
	march_party(15,13);
	march_party(15,12);
	force_view_center(15,12);
	force_instant_terrain_redraw();

	set_flag(1,0,1);
	}
break;